home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / slack-docs / base / sendmail.cf < prev    next >
Text File  |  1996-05-09  |  16KB  |  608 lines

  1. #
  2. # Copyright (c) 1983 Eric P. Allman
  3. # Copyright (c) 1988, 1993
  4. #    The Regents of the University of California.  All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions
  8. # are met:
  9. # 1. Redistributions of source code must retain the above copyright
  10. #    notice, this list of conditions and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. #    notice, this list of conditions and the following disclaimer in the
  13. #    documentation and/or other materials provided with the distribution.
  14. # 3. All advertising materials mentioning features or use of this software
  15. #    must display the following acknowledgement:
  16. #    This product includes software developed by the University of
  17. #    California, Berkeley and its contributors.
  18. # 4. Neither the name of the University nor the names of its contributors
  19. #    may be used to endorse or promote products derived from this software
  20. #    without specific prior written permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  23. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  26. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. # SUCH DAMAGE.
  33. #
  34.  
  35.  
  36. ######################################################################
  37. ######################################################################
  38. #####
  39. #####        SENDMAIL CONFIGURATION FILE
  40. #####
  41. ##### built by root@linux on Fri Jul 21 01:16:42 BST 1995
  42. ##### in /usr/src/sendmail/cf
  43. #####
  44. ######################################################################
  45. ######################################################################
  46.  
  47. #####  @(#)cf.m4    8.4 (Berkeley) 12/24/93  #####
  48.  
  49. #####  @(#)linux.demon.cf 3.2 (linux.demon.co.uk) 06-May-96  #####
  50.  
  51. #####  @(#)linux.m4    8.2 (Berkeley) 8/21/93  #####
  52.  
  53.  
  54. #####  @(#)always_add_domain.m4    8.1 (Berkeley) 6/7/93  #####
  55.  
  56.  
  57. #####  @(#)nocanonify.m4    8.1 (Berkeley) 6/7/93  #####
  58.  
  59.  
  60. #####  @(#)nouucp.m4    8.1 (Berkeley) 6/7/93  #####
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. #####  @(#)proto.m4    8.45 (Berkeley) 3/4/94  #####
  69.  
  70.  
  71. # level 5 config file format
  72. V5
  73.  
  74. ##################
  75. #   local info   #
  76. ##################
  77.  
  78. Cwlocalhost
  79.  
  80.  
  81. CP.
  82.  
  83. # "Smart" relay host (may be null)
  84. DSsmtp:post.demon.co.uk
  85.  
  86. # who I send unqualified names to (null means deliver locally)
  87. DR
  88.  
  89. # who gets all local email traffic ($R has precedence for unqualified names)
  90. DH
  91.  
  92. # who I masquerade as (null for no masquerading)
  93. DM
  94.  
  95. # class L: names that should be delivered locally, even if we have a relay
  96. # class E: names that should be exposed as from this host, even if we masquerade
  97. #CLroot
  98. CEroot
  99.  
  100. # operators that cannot be in local usernames (i.e., network indicators)
  101. CO @ % 
  102.  
  103. # a class with just dot (for identifying canonical names)
  104. C..
  105.  
  106. # dequoting map
  107. Kdequote dequote
  108.  
  109.  
  110. ######################
  111. #   Special macros   #
  112. ######################
  113.  
  114. # SMTP initial login message
  115. De$j Sendmail $v/$Z ready at $b
  116.  
  117. # UNIX initial From header format
  118. DlFrom $g  $d
  119.  
  120. # my name for error messages
  121. DnMAILER-DAEMON
  122.  
  123. # delimiter (operator) characters
  124. Do.:%@!^/[]
  125.  
  126. # format of a total name
  127. Dq$?x$x <$g>$|$g$.
  128.  
  129. # Configuration version number
  130. DZv3.2
  131.  
  132.  
  133. ###############
  134. #   Options   #
  135. ###############
  136.  
  137. # strip message body to 7 bits on input?
  138. O7False
  139.  
  140. # wait (in minutes) for alias file rebuild
  141. Oa10
  142.  
  143. # location of alias file
  144. OA/etc/aliases
  145.  
  146. # minimum number of free blocks on filesystem
  147. Ob4
  148.  
  149. # substitution for space (blank) characters
  150. OB.
  151.  
  152. # avoid connecting to "expensive" mailers on initial submission?
  153. OcFalse
  154.  
  155. # checkpoint queue runs after every N successful deliveries
  156. OC10
  157.  
  158. # default delivery mode
  159. Odbackground
  160.  
  161. # automatically rebuild the alias database?
  162. ODFalse
  163.  
  164. # error message header/file
  165. #OE/etc/sendmail.oE
  166.  
  167. # error mode
  168. #Oep
  169.  
  170. # save Unix-style "From_" lines at top of header?
  171. OfFalse
  172.  
  173. # temporary file mode
  174. OF0600
  175.  
  176. # match recipients against GECOS field?
  177. OGFalse
  178.  
  179. # default GID
  180. Og1
  181.  
  182. # maximum hop count
  183. Oh17
  184.  
  185. # location of help file
  186. OH/usr/lib/sendmail.hf
  187.  
  188. # ignore dots as terminators in incoming messages?
  189. OiFalse
  190.  
  191. # Insist that the BIND name server be running to resolve names
  192. OI
  193.  
  194. # deliver MIME-encapsulated error messages?
  195. OjFalse
  196.  
  197. # Forward file search path
  198. #OJ/var/forward/$u:$z/.forward.$w:$z/.forward
  199.  
  200. # open connection cache size
  201. Ok2
  202.  
  203. # open connection cache timeout
  204. OK5m
  205.  
  206. # use Errors-To: header?
  207. OlFalse
  208.  
  209. # log level
  210. OL9
  211.  
  212. # send to me too, even in an alias expansion?
  213. OmFalse
  214.  
  215. # verify RHS in newaliases?
  216. OnTrue
  217.  
  218. # default messages to old style headers if no special punctuation?
  219. OoTrue
  220.  
  221. # SMTP daemon options
  222. #OOPort=esmtp
  223.  
  224. # privacy flags
  225. Opauthwarnings
  226.  
  227. # who (if anyone) should get extra copies of error messages
  228. #OPPostmaster
  229.  
  230. # slope of queue-only function
  231. #Oq600000
  232.  
  233. # queue directory
  234. OQ/var/spool/mqueue
  235.  
  236. # read timeout -- now OK per RFC 1123 section 5.3.2
  237. #Ordatablock=10m
  238.  
  239. # queue up everything before forking?
  240. OsTrue
  241.  
  242. # status file
  243. OS/etc/sendmail.st
  244.  
  245. # default message timeout interval
  246. OT5d/4h
  247.  
  248. # time zone handling:
  249. #  if undefined, use system default
  250. #  if defined but null, use TZ envariable passed in
  251. #  if defined and non-null, use that info
  252. #Ot
  253.  
  254. # default UID
  255. Ou1
  256.  
  257. # list of locations of user database file (null means no lookup)
  258. OU
  259.  
  260. # fallback MX host
  261. #OVfall.back.host.net
  262.  
  263. # if we are the best MX host for a site, try it directly instead of config err
  264. OwFalse
  265.  
  266. # load average at which we just queue messages
  267. Ox8
  268.  
  269. # load average at which we refuse connections
  270. OX12
  271.  
  272. # work recipient factor
  273. #Oy30000
  274.  
  275. # deliver each queued job in a separate process?
  276. OYFalse
  277.  
  278. # work class factor
  279. #Oz1800
  280.  
  281. # work time factor
  282. #OZ90000
  283.  
  284. ###########################
  285. #   Message precedences   #
  286. ###########################
  287.  
  288. Pfirst-class=0
  289. Pspecial-delivery=100
  290. Plist=-30
  291. Pbulk=-60
  292. Pjunk=-100
  293.  
  294. #####################
  295. #   Trusted users   #
  296. #####################
  297.  
  298. Troot
  299. Tdaemon
  300. Tuucp
  301.  
  302. #########################
  303. #   Format of headers   #
  304. #########################
  305.  
  306. H?P?Return-Path: $g
  307. HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
  308. H?D?Resent-Date: $a
  309. H?D?Date: $a
  310. H?F?Resent-From: $q
  311. H?F?From: $q
  312. H?x?Full-Name: $x
  313. HSubject:
  314. # HPosted-Date: $a
  315. # H?l?Received-Date: $b
  316. H?M?Resent-Message-Id: <$t.$i@$j>
  317. H?M?Message-Id: <$t.$i@$j>
  318. #
  319. ######################################################################
  320. ######################################################################
  321. #####
  322. #####            REWRITING RULES
  323. #####
  324. ######################################################################
  325. ######################################################################
  326.  
  327.  
  328. ###########################################
  329. ###  Rulset 3 -- Name Canonicalization  ###
  330. ###########################################
  331. S3
  332.  
  333. # handle null input (translate to <@> special case)
  334. R$@            $@ <@>
  335.  
  336. # basic textual canonicalization -- note RFC733 heuristic here
  337. R$*<$*>$*<$*>$*        $2$3<$4>$5            strip multiple <> <>
  338. R$*<$*<$+>$*>$*        <$3>$5                2-level <> nesting
  339. R$*<>$*            $@ <@>                MAIL FROM:<> case
  340. R$*<$+>$*        $2                basic RFC821/822 parsing
  341.  
  342. # handle list:; syntax as special case
  343. R$*:;$*            $@ $1 :; <@>
  344.  
  345. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  346. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  347.  
  348. # localize and dispose of route-based addresses
  349. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  350.  
  351. # find focus for list syntax
  352. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  353. R $+ : $* ;        $@ $1 : $2;            list syntax
  354.  
  355. # find focus for @ syntax addresses
  356. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  357. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  358. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  359.  
  360. # do some sanity checking
  361. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  362.  
  363.  
  364. # if we have % signs, take the rightmost one
  365. R$* % $*        $1 @ $2                First make them all @s.
  366. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  367. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  368.  
  369. # else we must be a local name
  370.  
  371.  
  372. ################################################
  373. ###  Ruleset 96 -- bottom half of ruleset 3  ###
  374. ################################################
  375.  
  376. #  At this point, everything should be in a "local_part<@domain>extra" format.
  377. S96
  378.  
  379. # handle special cases for local names
  380. R$* < @ localhost > $*        $: $1 < @ $j . > $2        no domain at all
  381. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2        local domain
  382. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3        mark [a.b.c.d]
  383. R$* < @@ $=w > $*        $: $1 < @ $j . > $3        self-literal
  384. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3        canon IP addr
  385.  
  386.  
  387. # local host aliases and pseudo-domains are always canonical
  388. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  389. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  390. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  391.  
  392. # if this is the local hostname, make sure we treat is as canonical
  393. R$* < @ $j > $*            $: $1 < @ $j . > $2
  394.  
  395.  
  396. ##################################################
  397. ###  Ruleset 4 -- Final Output Post-rewriting  ###
  398. ##################################################
  399. S4
  400.  
  401. R$*<@>            $@ $1                handle <> and list:;
  402.  
  403. # strip trailing dot off possibly canonical name
  404. R$* < @ $+ . > $*    $1 < @ $2 > $3
  405.  
  406. # externalize local domain info
  407. R$* < $+ > $*        $1 $2 $3            defocus
  408. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  409. R@ $*            $@ @ $1                ... and exit
  410.  
  411.  
  412. # delete duplicate local names
  413. R$+ % $=w @ $=w        $1 @ $j                u%host@host => u@host
  414.  
  415.  
  416.  
  417. ##############################################################
  418. ###   Ruleset 97 -- recanonicalize and call ruleset zero   ###
  419. ###           (used for recursive calls)           ###
  420. ##############################################################
  421.  
  422. S97
  423. R$*            $: $>3 $1
  424. R$*            $@ $>0 $1
  425.  
  426.  
  427. ######################################
  428. ###   Ruleset 0 -- Parse Address   ###
  429. ######################################
  430.  
  431. S0
  432.  
  433. R<@>            $#local $: <>            special case error msgs
  434. R$* : $* ;        $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
  435. R<@ $+>            $#error $@ USAGE $: "user address required"
  436. R<$* : $* >        $#error $@ USAGE $: "colon illegal in host name part"
  437.  
  438. # handle numeric address spec
  439. R$* < @ [ $+ ] > $*    $: $>98 $1 < @ [ $2 ] > $3    numeric internet spec
  440. R$* < @ [ $+ ] > $*    $#smtp $@ [$2] $: $1 < @ [$2] > $3    still numeric: send
  441.  
  442. # now delete the local info -- note $=O to find characters that cause forwarding
  443. R$* < @ > $*        $@ $>97 $1        user@ => user
  444. R< @ $=w . > : $*    $@ $>97 $2        @here:... -> ...
  445. R$* $=O $* < @ $=w . >    $@ $>97 $1 $2 $3        ...@here -> ...
  446.  
  447. # handle local hacks
  448. R$*            $: $>98 $1
  449.  
  450. # short circuit local delivery so forwarded email works
  451. R$+ < @ $=w . >        $: $1 < @ $2 . @ $H >        first try hub
  452. R$+ < $+ @ $+ >        $#local $: $1            yep ....
  453. R$+ < $+ @ >        $#local $: @ $1            nope, local address
  454.  
  455.  
  456. # resolve fake top level domains by forwarding to other hosts
  457.  
  458.  
  459.  
  460. # pass names that still have a host to a smarthost (if defined)
  461. R$* < @ $* > $*        $: $>95 < $S > $1 < @ $2 > $3    glue on smarthost name
  462.  
  463. # deal with other remote names
  464. R$* < @$* > $*        $#smtp $@ $2 $: $1 < @ $2 > $3        user@host.domain
  465.  
  466. # if this is quoted, strip the quotes and try again
  467. R$+            $: $(dequote $1 $)        strip quotes
  468. R$+ $=O $+        $@ $>97 $1 $2 $3            try again
  469.  
  470. # handle locally delivered names
  471. R$=L            $#local $: @ $1            special local names
  472. R$+            $#local $: $1            regular local names
  473.  
  474. ###########################################################################
  475. ###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
  476. ###           (new sendmail only)                    ###
  477. ###########################################################################
  478.  
  479. S5
  480.  
  481. # see if we have a relay or a hub
  482. R$+            $: < $R > $1            try relay
  483. R< > $+            $: < $H > $1            try hub
  484. R< > $+            $@ $1                nope, give up
  485. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  486. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  487.  
  488. ###################################################################
  489. ###  Ruleset 95 -- canonify mailer:host syntax to triple    ###
  490. ###################################################################
  491.  
  492. S95
  493. R< > $*            $@ $1                strip off null relay
  494. R< $- : $+ > $*        $# $1 $@ $2 $: $3        try qualified mailer
  495. R< $=w > $*        $@ $2                delete local host
  496. R< $+ > $*        $#relay $@ $1 $: $2        use unqualified mailer
  497.  
  498. ###################################################################
  499. ###  Ruleset 98 -- local part of ruleset zero (can be null)    ###
  500. ###################################################################
  501.  
  502. S98
  503. #
  504. ######################################################################
  505. ######################################################################
  506. #####
  507. #####            MAILER DEFINITIONS
  508. #####
  509. ######################################################################
  510. ######################################################################
  511.  
  512.  
  513. ##################################################
  514. ###   Local and Program Mailer specification   ###
  515. ##################################################
  516.  
  517. #####  @(#)local.m4    8.6 (Berkeley) 10/24/93  #####
  518.  
  519. Mlocal,        P=/usr/bin/deliver, F=lsDFMShP, S=10, R=20/40,
  520.         A=deliver $u
  521. Mprog,        P=/bin/sh, F=lsDFMeu, S=10, R=20/40, D=$z:/,
  522.         A=sh -c $u
  523.  
  524. S10
  525. R<@>            $n            errors to mailer-daemon
  526. R$+            $: $>40 $1
  527.  
  528. S20
  529. R$+ < @ $* >        $: $1            strip host part
  530.  
  531. S40
  532. R$* < @ $* > $*        $@ $1 < @ $2 > $3    already fully qualified
  533. R$*            $: $1 @ $M        add local qualification
  534. R$* @            $: $1 @ $j        if $M not defined
  535.  
  536. #####################################
  537. ###   SMTP Mailer specification   ###
  538. #####################################
  539.  
  540. #####  @(#)smtp.m4    8.15 (Berkeley) 2/14/94  #####
  541.  
  542. Msmtp,        P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n,
  543.         L=990, A=IPC $h
  544. Mesmtp,        P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n,
  545.         L=990, A=IPC $h
  546. Mrelay,        P=[IPC], F=mDFMuXa, S=11/31, R=61, E=\r\n,
  547.         L=2040, A=IPC $h
  548.  
  549. #
  550. #  envelope sender and masquerading recipient rewriting
  551. #
  552. S11
  553. R$+            $: $>51 $1            sender/recipient common
  554. R$* :; <@>        $@ $1 :;            list:; special case
  555. R$*            $@ $>61 $1            qualify unqual'ed names
  556.  
  557.  
  558. #
  559. #  header recipient rewriting if not masquerading recipients
  560. #
  561. S21
  562.  
  563. # do sender/recipient common rewriting
  564. R$+            $: $>51 $1
  565.  
  566. # unqualified names (e.g., "eric") are qualified by local host
  567. R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  568. R$+            $: $1 < @ $j >            add local domain
  569.  
  570.  
  571. #
  572. #  header sender and masquerading recipient rewriting
  573. #
  574. S31
  575. R$+            $: $>51 $1            sender/recipient common
  576. R$* :; <@>        $@ $1 :;            list:; special case
  577.  
  578. # do special header rewriting
  579. R$* <@> $*        $@ $1 <@> $2            pass null host through
  580. R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  581. R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  582. R$* < @ $=w . >        $: $1 < @ $2 @ $M >        masquerade as domain
  583. R$* < @ $+ @ >        $@ $1 < @ $2 >            in case $M undefined
  584. R$* < @ $+ @ $+ >    $@ $1 < @ $3 >            $M is defined -- use it
  585. R$*            $@ $>61 $1            qualify unqual'ed names
  586.  
  587.  
  588. #
  589. #  convert pseudo-domain addresses to real domain addresses
  590. #
  591. S51
  592.  
  593. # pass <route-addr>s through
  594. R< @ $+ > $*        $@ < @ $1 > $2            resolve <route-addr>
  595.  
  596. # output fake domains as user%fake@relay
  597.  
  598.  
  599. #
  600. #  common sender and masquerading recipient rewriting
  601. #
  602. S61
  603.  
  604. R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  605. R$=E            $@ $1 < @ $j>            show exposed names
  606. R$+            $: $1 < @ $M >            user w/o host
  607. R$+ <@>            $: $1 < @ $j >            in case $M undefined
  608.